package com.bigfish.crm.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bigfish.common.utils.PageItem;
import com.bigfish.crm.dao.LevelRuleDao;
import com.bigfish.crm.dto.LevelRule;

@Service
public class LevelRuleService {
	@Autowired
	private LevelRuleDao levelRuleDao;
	
	@Autowired
	private MyKieService myKieService;

	public void insertLevelRule(LevelRule rule) {
		levelRuleDao.insert(rule);
	}
	public List<LevelRule> ableRuleList(){
		return levelRuleDao.ableRuleList();
	}
	public List<LevelRule> getLevelRuleList(PageItem page) {
		return levelRuleDao.getLevelRuleList(page);
	}
	public LevelRule getLevelRuleById(int id) {
		return levelRuleDao.selectByPrimaryKey(id);
	}
	public void refreshRules() {
		myKieService.refreshKieSession();
	}
	
}
